package com.chenhan.common.core.support;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

@AllArgsConstructor
@NoArgsConstructor
public abstract class BaseServiceImpl<M extends BaseMapperX<T>, T> extends ServiceImpl<M, T> implements BaseService<T> {

	@Autowired
	protected M baseMapper;

	@Override
	public List<T> queryList(Map<String, Object> queryMap){
		return baseMapper.queryList(queryMap);
	}

	@Override
	public PageResult<T> queryPage(PageQuery pageQuery, Map<String, Object> queryMap){
		return baseMapper.queryPage(pageQuery.build(), queryMap);
	}

	@Override
	public T queryOne(Map<String, Object> queryMap){
		return baseMapper.queryOne(queryMap);
	}



}
